//
// Created by jsjxsy on 2022/6/24.
//
#include <stdio.h>
#include <stdarg.h>

void ArgsPrintf(const char *format, ...) {
    va_list args;
    va_start(args, format);
    vprintf(format, args);
    va_end(args);

}

#if defined(__APPLE__) || defined(__linux__)

#include <sys/stat.h>
#include <dirent.h>

#elif defined(__WIN32__)
#include <dirent.h>
#endif
#define MODE (S_IRWXU | S_IRWXG | S_IRWXO)

int mk_dir(char *dir) {
    DIR *mydir = NULL;
    if ((mydir = opendir(dir)) == NULL)//判断目录
    {
        int ret = mkdir(dir, MODE);//创建目录
        if (ret != 0) {
            return -1;
        }
        printf("%s created success!\n", dir);
    } else {
        printf("%s exist!\n", dir);
    }

    return 0;
}

int main() {
//    ArgsPrintf("my name is %s\n", "xsy");
//    ArgsPrintf("my age is %d\n", 10);
    mk_dir("new_data");
    return 0;
}

